//
//  XXBPresentTransitioningAnimation.m
//  XXBNavDemo
//
//  Created by sina on 2020/12/11.
//  Copyright © 2020 xiaobing. All rights reserved.
//

#import "XXBPresentTransitioningAnimation.h"

@implementation XXBPresentTransitioningAnimation

- (void)animateTransitionEvent {
    
    UIView *toView   = self.toViewController.view;
    UIView *fromeView   = self.fromViewController.view;
    CGRect screenBounds = [UIScreen mainScreen].bounds;
    CGFloat screenW = screenBounds.size.width;
    CGFloat screenH = screenBounds.size.height;
    toView.frame = CGRectMake(0, screenH, screenW, screenH);
    self.containerView.backgroundColor = [UIColor blackColor];
    [self.containerView addSubview:fromeView];
    [self.containerView addSubview:toView];
    [UIView animateWithDuration:self.transitionDuration animations:^{
        toView.frame = screenBounds;
        toView.frame = screenBounds;
    } completion:^(BOOL finished) {
        [self completeTransition];
    }];
}
@end
